package cn.edu.scau.cmi.hekaimin.simpleFactoryMethod;

import javafx.fxml.FXML;

import javafx.scene.control.Button;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;

import javafx.scene.control.TextArea;

import javafx.scene.control.ComboBox;

public class SimpleFactoryMethodController {
	@FXML
	private TextArea textArea_1;
	@FXML
	private Button btn_1;
	@FXML
	private ComboBox comboBox;

	public void init() {
		ObservableList<String> options = FXCollections.observableArrayList("身体受伤","汽车损坏","人员伤亡", "多种事故");
	    this.comboBox.setItems(options);
		this.comboBox.getSelectionModel().select(0);
	}
	@FXML
	public void showAction(ActionEvent event) {
	  Insurance insurance = InsuranceFactory.getInsurance((String) this.comboBox.getValue());
	   this.textArea_1.setText(insurance.getDetail());
	}
}
